package com.sjh.test.java8.time;

import java.time.LocalDateTime;

public class LocalDateTimeTest4 {

    public static void main(String args[]) {
        LocalDateTimeTest4 tester = new LocalDateTimeTest4();
        tester.run();
    }

    public void run() {
        LocalDateTime currentTime = LocalDateTime.now();
        System.out.println("当前日期时间: " + currentTime);

        LocalDateTime date2 = currentTime.withDayOfMonth(10).withYear(2019);
        System.out.println("新的日期时间: " + date2);

        System.out.println("原来的日期时间: " + currentTime);
    }
}
